package services.impl;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import services.*;
	
public class ServiceManager {
	
	private static Map<String, List> AllServiceInstance = new HashMap<String, List>();
	
	private static List<NewBikeSharingSystemSystem> NewBikeSharingSystemSystemInstances = new LinkedList<NewBikeSharingSystemSystem>();
	private static List<ThirdPartyServices> ThirdPartyServicesInstances = new LinkedList<ThirdPartyServices>();
	private static List<RegisterAccountService> RegisterAccountServiceInstances = new LinkedList<RegisterAccountService>();
	private static List<UnlockVehicleService> UnlockVehicleServiceInstances = new LinkedList<UnlockVehicleService>();
	private static List<TrackRidingCostsService> TrackRidingCostsServiceInstances = new LinkedList<TrackRidingCostsService>();
	private static List<ProcessMaintenanceRequestsService> ProcessMaintenanceRequestsServiceInstances = new LinkedList<ProcessMaintenanceRequestsService>();
	
	static {
		AllServiceInstance.put("NewBikeSharingSystemSystem", NewBikeSharingSystemSystemInstances);
		AllServiceInstance.put("ThirdPartyServices", ThirdPartyServicesInstances);
		AllServiceInstance.put("RegisterAccountService", RegisterAccountServiceInstances);
		AllServiceInstance.put("UnlockVehicleService", UnlockVehicleServiceInstances);
		AllServiceInstance.put("TrackRidingCostsService", TrackRidingCostsServiceInstances);
		AllServiceInstance.put("ProcessMaintenanceRequestsService", ProcessMaintenanceRequestsServiceInstances);
	} 
	
	public static List getAllInstancesOf(String ClassName) {
			 return AllServiceInstance.get(ClassName);
	}	
	
	public static NewBikeSharingSystemSystem createNewBikeSharingSystemSystem() {
		NewBikeSharingSystemSystem s = new NewBikeSharingSystemSystemImpl();
		NewBikeSharingSystemSystemInstances.add(s);
		return s;
	}
	public static ThirdPartyServices createThirdPartyServices() {
		ThirdPartyServices s = new ThirdPartyServicesImpl();
		ThirdPartyServicesInstances.add(s);
		return s;
	}
	public static RegisterAccountService createRegisterAccountService() {
		RegisterAccountService s = new RegisterAccountServiceImpl();
		RegisterAccountServiceInstances.add(s);
		return s;
	}
	public static UnlockVehicleService createUnlockVehicleService() {
		UnlockVehicleService s = new UnlockVehicleServiceImpl();
		UnlockVehicleServiceInstances.add(s);
		return s;
	}
	public static TrackRidingCostsService createTrackRidingCostsService() {
		TrackRidingCostsService s = new TrackRidingCostsServiceImpl();
		TrackRidingCostsServiceInstances.add(s);
		return s;
	}
	public static ProcessMaintenanceRequestsService createProcessMaintenanceRequestsService() {
		ProcessMaintenanceRequestsService s = new ProcessMaintenanceRequestsServiceImpl();
		ProcessMaintenanceRequestsServiceInstances.add(s);
		return s;
	}
}	
